package com.example.mapper;

import com.example.aop.Log;
import com.example.pojo.Emp;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {


    public List<Emp> page(@Param("name") String name,@Param("gender") Integer gender,@Param("begin") LocalDate begin, @Param("end") LocalDate end);
    @Log
    void delect(@Param("ids") List<Integer> ids);
@Insert("insert into emp (username, password, name, gender, image, job, entrydate, dept_id, create_time, update_time) " +
        "VALUES (#{username},#{password},#{name},#{gender},#{image},#{job},#{entrydate},#{deptId},#{createTime},#{updateTime})")
    void insert(Emp emp);
@Select("select id, username, password, name, gender, image, job, entrydate, dept_id, create_time, update_time from emp where id = #{id}")
    Emp select(Integer id);
    @Log
    void updata(Emp emp);
@Select("select *from emp where username = #{username} and password = #{password}")
    Emp getEmpbyUsernameandPassword(Emp emp);
}
